package com.cms.model;

import com.cms.plugin.db.Model;
import com.cms.plugin.db.Page;
import com.cms.plugin.db.annotation.Table;

@Table("s_upload_config")
public class UpConfig extends Model<UpConfig>{

	
	public static final UpConfig dao = new UpConfig();
	/**
	 * 
	 */
	private static final long serialVersionUID = 1672491504604978271L;
	/**
	 * 所有 sql 写在 Model 或 Service 中，不要写在 Controller 中，养成好习惯，有利于大型项目的开发与维护
	 */
	public Page<UpConfig> paginate(int pageNumber, int pageSize) {
		return paginate(pageNumber, pageSize, "select *", "from s_upload_config order by id desc");
	}
	public UpConfig findByChannel(String channel) {
		return findFirst("select * from s_upload_config where channel=?",channel);
	}
}
